package com.baida.retail.tasksystem.controller;

import com.baida.retail.tasksystem.entity.User;
import com.baida.retail.tasksystem.message.logic.Result;
import com.baida.retail.tasksystem.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("user")
@Api(value = "用户操作模块", tags = "用户模块")
public class UserController {
    @Autowired
    private UserService userService;

    @GetMapping("/getUsers")
    @ApiOperation(
            value = "查找所有的用户列表",
            notes = "查找所有的用户列表的详细信息")
    @ApiResponses(
            @ApiResponse(code = 200, message = "操作成功", response = User.class)
    )
    public Result getUsers() {
        return userService.getUsers();
    }
}
